/**
 * 
 */
package uea.pdd.pf2;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * @author fernando luna
 *
 */
public class PacientActivity extends Activity implements OnClickListener{
	
	String nomPac, telPac;

	/* (non-Javadoc)
	 * @see android.app.Activity#onCreate(android.os.Bundle)
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		Log.v(MainActivity.CATEGORY, "onCreate PacientActivity");
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_cadpac);
		
		Button btSavePac = (Button) findViewById(R.id.bt_save_pac);
		
		btSavePac.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Log.v(MainActivity.CATEGORY, "onClick PacientActivity");
		switch (v.getId()){
		
		case R.id.bt_save_pac:{
			Log.i(MainActivity.CATEGORY, "Click no botao salvar...");
			Intent intent = new Intent(PacientActivity.this, MainActivity.class);
			startActivity(intent);
			nomPac = getText(R.id.et_nom_pac).toString();
			telPac = getText(R.id.et_tel_pac).toString();
			}
		}
	}

	/* (non-Javadoc)
	 * @see android.app.Activity#onDestroy()
	 */
	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		finish();
	}

	/* (non-Javadoc)
	 * @see android.app.Activity#onPause()
	 */
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		finish();
	}

}
